import { Map } from "immutable";
//constants actionCreators reducer index #目前可能用不到redux 所以暂时先不细分
//actions reducers
const defaultState = Map({
  token: sessionStorage.getItem('token'),
});

interface action {
  type: string;
  data?: any;
}

function reducer(state = defaultState, action: action) {
  switch (action.type) {
    case "setToken":
      return state.set("token", action.data);
    default:
      return state;
  }
}
export default reducer;
